// Refs from: https://semgrep.dev/playground/r/kotlin.lang.security.weak-rsa.use-of-weak-rsa-key?editorMode=advanced
import java.security.KeyPairGenerator

fun main() {
    println("Hello, World!")
}

public class WeakRSA {
  fun rsaWeak(): Void {
    // ruleid: use-of-weak-rsa-key
    val keyGen: KeyPairGenerator = KeyPairGenerator.getInstance("RSA")
    keyGen.initialize(512)
  }

  fun rsaOK(): Void {
    // ok: use-of-weak-rsa-key
    val keyGen = KeyPairGenerator.getInstance("RSA");
    keyGen.initialize(2048);
  }
}